using Npgsql;
using System;

namespace PTransaction
{
	public class DbConnection
	{
		private DbConnection ()
		{
		}
		
		private static DbConnection instance = new DbConnection();
		public static DbConnection Instance {
			get {return instance;}
		}
		
		private static string connectionString;
		public static string ConnectionString {
			set {connectionString = value;}
		}

		private NpgsqlConnection connection;
		public NpgsqlConnection Connection {
			get {
				if (connection == null) {
					connection = new NpgsqlConnection(connectionString);
					connection.Open();
				}
				return connection;
			}
		}
	}
}
